﻿using T4UtilityBelt.LightSwitch.FileModels;
using T4UtilityBelt.Serializers;

namespace T4UtilityBelt.Templates
{
    public abstract class LightSwitchToEntityModelXmlTemplate : Template
    {
        public static string RenderXml(string fileName)
        {
            ModelFragment lightSwitchModel = ModelFragment.Load(fileName);

            T4UtilityBelt.DataDesigns.EntityModel entityModel = lightSwitchModel.ToEntityModel();

            XSerializer xs = new XSerializer();

            return xs.Serialize(entityModel);
        }
    }
}